/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.webbapps.cormac_susilo.core;

import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * A data point registered during a Run.
 * @author tor
 */
@Entity
@Table(name = "Frames")
public class Frame extends AbstractEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO )
    private long id;
    
    @ManyToOne
    @JoinColumn(name = "run_id", nullable = false)
    private Run run;
    
    @Temporal(TemporalType.TIMESTAMP)
    private Date time_label; // UNIX time
    private int pulse;
    private double lon; // degrees
    private double lat; // degrees
    private double alt;
    private double speed; // m/s
    private double distance; //accumulated
    
    @Override
    public Long getId() {
        return id;
    }
    
    
    public Run getRun() {
        return run;
    }
    
    
    public void setRun(Run run) {
        this.run = run;
    }

    
    public int getPulse() {
        return pulse;
    }

    
    public void setPulse(int pulse) {
        this.pulse = pulse;
    }

    
    public double getLon() {
        return lon;
    }

    
    public void setLon(double lon) {
        this.lon = lon;
    }

    
    public double getLat() {
        return lat;
    }

    
    public void setLat(double lat) {
        this.lat = lat;
    }

    
    public double getAlt() {
        return alt;
    }

    
    public void setAlt(double alt) {
        this.alt = alt;
    }

    
    public double getSpeed() {
        return speed;
    }

    
    public void setSpeed(double speed) {
        this.speed = speed;
    }

    
    public Date getTime_label() {
        return time_label;
    }

    
    public void setTime_label(Date time_label) {
        this.time_label = time_label;
    }
    
    
    public double getDistance() {
        return distance;
    }

    
    public void setDistance(double distance) {
        this.distance = distance;
    }
    
}
